using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class so_PatienttransMap : EntityTypeConfiguration<so_Patienttrans>
    {
        public so_PatienttransMap()
        {
            // Primary Key
            this.HasKey(t => new { t.treatement_Date, t.Patient_Deductible, t.Total_Amount });

            // Properties
            this.Property(t => t.invoice_)
                .HasMaxLength(8);

            this.Property(t => t.cardnumber)
                .HasMaxLength(50);

            this.Property(t => t.company)
                .HasMaxLength(33);

            this.Property(t => t.Address)
                .HasMaxLength(33);

            this.Property(t => t.soap_)
                .HasMaxLength(50);

            this.Property(t => t.Patient)
                .HasMaxLength(110);

            // Table & Column Mappings
            this.ToTable("so_Patienttrans");
            this.Property(t => t.invoice_).HasColumnName("invoice#");
            this.Property(t => t.treatement_Date).HasColumnName("treatement_Date");
            this.Property(t => t.cardnumber).HasColumnName("cardnumber");
            this.Property(t => t.company).HasColumnName("company");
            this.Property(t => t.Address).HasColumnName("Address");
            this.Property(t => t.soap_).HasColumnName("soap#");
            this.Property(t => t.Patient).HasColumnName("Patient");
            this.Property(t => t.Patient_Deductible).HasColumnName("Patient_Deductible");
            this.Property(t => t.Total_Amount).HasColumnName("Total_Amount");
            this.Property(t => t.Patient_Balance).HasColumnName("Patient_Balance");
        }
    }
}
